import request from "../index";
import { IUserInfoType, ILoginRequestDataType } from "./type";
import { IRequestType } from "../type";

export function numberLoginRequset(userInfo: IUserInfoType) {
  return request.post<IRequestType<ILoginRequestDataType>>({
    url: "/login",
    data: userInfo
  });
}

export function requestUserInfoById(id: number) {
  return request.get<IRequestType>({
    url: "/users/" + id
  });
}

export function requestUserMenuByRoleId(id: number) {
  return request.get<IRequestType>({
    url: `/role/${id}/menu`
  });
}
